﻿CREATE TABLE [dbo].[text_Text] (
    [TextId]    BIGINT           IDENTITY (1, 1) NOT NULL,
    [ChapterId] UNIQUEIDENTIFIER NOT NULL,
    [Value]     NVARCHAR (MAX)   NOT NULL,
    [Order]     INT              NOT NULL,
    [Tag]       NVARCHAR (32)    NOT NULL,
    [IsPublic]  BIT              NOT NULL,
    CONSTRAINT [PK_TextId] PRIMARY KEY CLUSTERED ([TextId] ASC),
    CONSTRAINT [FK_text_Text_text_Chapter] FOREIGN KEY ([ChapterId]) REFERENCES [dbo].[text_Chapter] ([ChapterId]),
    CONSTRAINT [IX_ChapterId_Order] UNIQUE NONCLUSTERED ([ChapterId] ASC, [Order] ASC)
);



